# -*- coding:utf-8 -*-

__author__ = 'dong'


import re

# 78
# self.checkBoxGroup_ft.addButton(self.obj.ui.checkBox_78_1102, 1102)
line = '<li><ahref="?catid=93&cityid=0">环境工程和生态建设</a></li>'

# result = re.search(r'\d+', line)
# print result.group(0)

with open('e.txt', 'r') as fd:
    c = fd.readlines()
    # print c
    # print c
    # s  = c.replace('ym-submnu">', '\n')
    # with open('e.txt', 'w') as fd:
    #     fd.write(s)
    for line in c:
        result = str(re.search(r'\d+', line).group(0))
        print 'self.checkBoxGroup_se.addButton(self.obj.ui.checkBox_78_'+result+', '+result+')'














# import requests
#
#
# class se(object):
#
#     def __init__(self):
#         self.s = requests.session()
#         self.headers = {
#             "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
#             "Accept-Encoding": "gzip, deflate",
#             "Accept-Language":"zh-CN,zh;q=0.8",
#             "User-Agent":"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.87 Safari/537.36",
#             "Host": "www.78gk.com",
#             "Referer": "http://www.78gk.com/fabu.php?catid=61&cityid=0",
#             # "Content-Type": "multipart/form-data; charset=UTF-8"
#             # "Content-Type": "text/html; charset=gbk"
#         }
#
#     def post_msg(self):
#         '''
#
#         :return:
#         '''
#         print 'post...'
#         login_url = 'http://www.78gk.com/login.php'
#         login_data = {
#             'action': 'dopost',
#             'log_submit': '������¼',
#             'memory': 'on',
#             'mod': 'login',
#             'url': '',
#             'userid': '17727766372',
#             'userpwd': 'ab654321',
#         }
#         login = self.s.post(url=login_url, data=login_data)
#         print login.status_code
#         print login.headers
#         print login.content
#         _cookies = login.cookies
#
#         post_url = 'http://www.78gk.com/fabu.php?action=input&catid=1&cityid=0'
#         r =requests.get(url=post_url, cookies=_cookies, headers=self.headers)
#         with open('base.txt', 'w') as fd:
#             fd.write(r.content)
#
#
#
#
# if __name__ == '__main__':
#     s = se()
#     s.post_msg()